{"componentChunkName":"component---src-templates-blog-post-js","path":"/algorithm/위상정렬/","result":{"data":{"site":{"siteMetadata":{"title":"Tory","author":"[Tory]","siteUrl":"https://gatsby-starter-bee.netlify.com","comment":{"disqusShortName":"","utterances":"JaeYeopHan/gatsby-starter-bee"},"sponsor":{"buyMeACoffeeId":"jbee"}}},"markdownRemark":{"id":"d520ca59-de76-5871-9f5c-2bf193a9dabe","excerpt":"…","html":"<h1 id=\"위상-정렬\" style=\"position:relative;\"><a href=\"#%EC%9C%84%EC%83%81-%EC%A0%95%EB%A0%AC\" aria-label=\"위상 정렬 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>위상 정렬</h1>\n<p>정렬이라고 해서 마치 리스트의 정렬 알고리즘 처럼 값의 크기에 따라 각 값들을 정렬하는 것으로 착각할 수 있다. 하지만 이 개념과 혼동하지 않고 완전히 다른 시각으로 바라보아야 한다.\n위상 정렬이란 사이클이 없는 방향 그래프에서 모든 노드를 방향성에 거스르지 않고 순서대로 나열하는 방법이다. 즉 모든 노드를 순회하되 방향성에 맞게 순회하는 방법이라고 생각하면 된다.\n그래프에서 이 방법이 왜 필요할까? 예를들어 적분을 학습하기 위해서는 미분을 선행으로 학습해야하고, 미분을 학습하기 위해서는 공통수학을 선행학습해야 한다.\n결과적으로 그래프 내에서 특정 정점부터 적분까지 도달할 수 있는 경로는 여러 가지가 있을 것이다. 그 중에 루트(진입차수가 없는)노드를 기준으로 하나의 정점인 적분이 기준이 되었을 때, 어떤 노드로 부터 연결되었는지를 알아내는 방법이라고 볼 수 있다.</p>\n<h2 id=\"알고가야할-용어\" style=\"position:relative;\"><a href=\"#%EC%95%8C%EA%B3%A0%EA%B0%80%EC%95%BC%ED%95%A0-%EC%9A%A9%EC%96%B4\" aria-label=\"알고가야할 용어 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>알고가야할 용어</h2>\n<ul>\n<li>진입차수(Indegree): 특정한 노드로 들어오는 간선의 개수</li>\n<li>진출차수(Outdegree): 특정한 노드에서 나가는 간선의 개수</li>\n</ul>","frontmatter":{"title":"위상정렬","date":"May 09, 2021"}}},"pageContext":{"slug":"/algorithm/위상정렬/","previous":{"fields":{"slug":"/회고/4월-회고/"},"frontmatter":{"title":"4월 회고","category":"회고","draft":false}},"next":{"fields":{"slug":"/etc/planner/"},"frontmatter":{"title":"planner","category":"etc","draft":false}}}},"staticQueryHashes":["3128451518","521680639"]}